import request from "@/utils/request";

export function signup(data) {
  return request({
    url: "/signup",
    method: "POST",
    data,
  });
}
export function signin(data) {
  return request({
    url: "/signin",
    method: "POST",
    data,
  });
}

export function style() {
  return request({
    url: "/style",
    method: "GET",
  });
}

export function task(data) {
  return request({
    url: "/task",
    method: "POST",
    data,
  });
}

export function tasks(userid, size = 10) {
  return request({
    url: `/task?user=${userid}&size=${size}`,
    method: "GET",
  });
}

export function pass() {
  return request({
    url: "/task?pass=true",
    method: "GET",
  });
}

export function alltask(page = 1) {
  return request({
    url: "/task?page=" + page,
    method: "GET",
  });
}

export function deletetask(user, id) {
  return request({
    url: `/task?user=${user}&id=${id}`,
    method: "DELETE",
  });
}

export function like(data) {
  return request({
    url: "/task/like",
    method: "PUT",
    data,
  });
}
